var Campanha = require('../models/Campanha');
var mongoose = require('mongoose');
const bodyParser = require('body-parser');

// Get Single Article
exports.campanhaGet = function(req, res){
  Campanha.findOne({ 'urlname': req.params.urlname }, function(err, c){

    if (!c) {
      return res.redirect('/404');
    }
    else{
      res.render('campanha', {
        title: c.name,
        name: c.name,
        profile_pic: c.profile_pic,
        logo_pic: c.logo_pic,
        weneed: c.weneed,
        wehave: c.wehave,
        description: c.description,
        photo_pic: c.photo_pic,
        paypal_link: c.paypal_link,
        paypal_email: c.paypal_email,
        pagseguro: c.pagseguro,
        vakinha: c.vakinha,
        facebook_url: c.facebook_url,
        instagram_url: c.instagram_url
      });
    }
  });
};
